<?php

namespace addons\shopro\controller;

use addons\shopro\exception\Exception;
use app\admin\model\shopro\cats\Breed;

class Banner extends Base
{

    protected $noNeedLogin = ['lists'];
    protected $noNeedRight = ['*'];

    public function lists(){
        $bannerModel = new \app\admin\model\shopro\Banner();
        $lists = $bannerModel->where('status',1)->field('id,image,url,weigh,status')->order('weigh desc')->select();
        $bannerModel = new \addons\shopro\model\Banner();
        $lists = $bannerModel->where('status',1)->field('id,image,url,weigh,status')->order('weigh desc')->select();
        foreach ($lists as $val){
            $val['image'] = cdnurl($val['image'],true);
        }
        $result['lists'] = $lists;
        $this->success('轮播图列表',$result);
    }
}